﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGsPageParams : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGsPageParams(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGsPageParams obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGsPageParams()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGsPageParams(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public OdGsPageParams() : this(GlobalsPINVOKE.new_OdGsPageParams__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGsPageParams(double dPaperWidth, double dPaperHeight) : this(GlobalsPINVOKE.new_OdGsPageParams__SWIG_1(dPaperWidth, dPaperHeight), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGsPageParams(OdGsPageParams data) : this(GlobalsPINVOKE.new_OdGsPageParams__SWIG_2(OdGsPageParams.getCPtr(data)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGsPageParams Assign(OdGsPageParams from)
		{
			OdGsPageParams result = new OdGsPageParams(GlobalsPINVOKE.OdGsPageParams_Assign(this.swigCPtr, OdGsPageParams.getCPtr(from)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double getPaperWidth()
		{
			double result = GlobalsPINVOKE.OdGsPageParams_getPaperWidth(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double getPaperHeight()
		{
			double result = GlobalsPINVOKE.OdGsPageParams_getPaperHeight(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double getLeftMargin()
		{
			double result = GlobalsPINVOKE.OdGsPageParams_getLeftMargin(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double getRightMargin()
		{
			double result = GlobalsPINVOKE.OdGsPageParams_getRightMargin(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double getTopMargin()
		{
			double result = GlobalsPINVOKE.OdGsPageParams_getTopMargin(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double getBottomMargin()
		{
			double result = GlobalsPINVOKE.OdGsPageParams_getBottomMargin(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void set(double dPaperWidth, double dPaperHeight, double dLeftMargin, double dRightMargin, double dTopMargin, double dBottomMargin)
		{
			GlobalsPINVOKE.OdGsPageParams_set__SWIG_0(this.swigCPtr, dPaperWidth, dPaperHeight, dLeftMargin, dRightMargin, dTopMargin, dBottomMargin);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void set(double dPaperWidth, double dPaperHeight, double dLeftMargin, double dRightMargin, double dTopMargin)
		{
			GlobalsPINVOKE.OdGsPageParams_set__SWIG_1(this.swigCPtr, dPaperWidth, dPaperHeight, dLeftMargin, dRightMargin, dTopMargin);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void set(double dPaperWidth, double dPaperHeight, double dLeftMargin, double dRightMargin)
		{
			GlobalsPINVOKE.OdGsPageParams_set__SWIG_2(this.swigCPtr, dPaperWidth, dPaperHeight, dLeftMargin, dRightMargin);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void set(double dPaperWidth, double dPaperHeight, double dLeftMargin)
		{
			GlobalsPINVOKE.OdGsPageParams_set__SWIG_3(this.swigCPtr, dPaperWidth, dPaperHeight, dLeftMargin);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void set(double dPaperWidth, double dPaperHeight)
		{
			GlobalsPINVOKE.OdGsPageParams_set__SWIG_4(this.swigCPtr, dPaperWidth, dPaperHeight);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void scale(double dScale)
		{
			GlobalsPINVOKE.OdGsPageParams_scale(this.swigCPtr, dScale);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;
	}
}
